package gx.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import gx.dao.ProductDao;
import gx.entity.Product;
import gx.entity.common.Page;
import gx.service.common.BaseService;

@Service
public class ProductService extends BaseService<Product> {
public ProductDao productDao;

public ProductDao getProductDao() {
	return productDao;
}
@Autowired
public void setProductDao(ProductDao productDao) {
	this.productDao = productDao;
	super.setDao(this.productDao);
}

public Page<Product> findByName(int pageSize, int number, String values) {
	return productDao.findByName(pageSize,number,values);
}

public List<Product> findProducts(Integer category_id){
	return productDao.findProducts(category_id);
}
public Map<String, Long> totalInventoryByCategory(int year) {
	return productDao.totalInventoryByCategory( year);
}
public Map<String, Long> totalInventory(int year) {
	return productDao.totalInventory(year);
}
public Page<Product> findByDate(int pageSize, int number, Date endDate) {
	return productDao.findByDate(pageSize,number,endDate);
}
}
